#ifndef  __CMYPNGDRAW__
#define  __CMYPNGDRAW__

#include <atlimage.h>

BOOL LoadRes( UINT nResID, CImage& img, LPCTSTR lptype, HMODULE hModule );
void InitPng( CImage& img );

class CMyPngDraw
{
public:
	CMyPngDraw(void);
	~CMyPngDraw(void);
	void onPaint(HDC dc ,int x = 0);
	void OnPaint(HDC dc,int nX,int nY);

	void LoadPieture(UINT nResID , HDC BkDc , int nx ,int ny,HINSTANCE hIn);
	BOOL LoadImage(LPCTSTR pszFileName);
	int  LoadPng( HDC hDC, UINT nID, int nx, int ny, int nw, int nh, HMODULE hModule );
	bool OnMouseMove(HDC dc, POINT pt,int ndx);
	void OnLButtonUp(HDC dc);
	bool LoadGdiImage(HINSTANCE hInstance, LPCTSTR pszResourceName);
    bool DrawImage(HDC Dc, INT nXDest, INT nYDest, INT nDestWidth, INT nDestHeight, INT nXScr, INT YSrc, INT nSrcWidth, INT nSrcHeight);
	void DrawImage(HDC Dc, INT nXDest, INT nYDest);
	void DrawImage(HDC Dc, INT nXDest, INT nYDest,INT DestWight);
public:
	BOOL m_bIsPaint;
	HDC  m_btnDC[3];
	RECT m_BtnRt;
	HDC  m_PngDc;
	int  m_nx;
	int  m_ny;
	int  m_nW;
	int  m_nH;
#ifdef USERGDI
	Image *	m_pImage;
#endif
	
};
#endif
